<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>按件规则管理导入帮助</title>
    <script src="../assets/js/jquery-1.10.2.js"></script>
    <style type="text/css">
          #supplier,#province,#city,#county{
            width: 300px;
            height:50px;
              text-align: center;
              border: solid;
        }
    </style>
</head>
<body>
        <row>
            <h3 style="color:red;">注意</h3>
            <span>
                根据头部名字匹配值导入数据，所以模板的头部名字一定不能变
            </span>
        </row>
        <row>
            <h3>机构类型</h3>
            <table border="2">
                <thead><tr><th colspan="4">所有取值</th></thead>
                <thead align="center"><tr><th>自营</th><th>合作站</th><th>合作商</th><th>大型合作商</th></tr></thead>
            </table>
        </row>
        <row>
            <h3>配送类型</h3>
            <table border="2">
                <thead><tr><th colspan="3">所有取值</th></thead>
                <thead align="center"><th>配送</th><th>上门退</th><th>上门换</th></tr></thead>
            </table>
        </row>
        <row>
            <h3>运输温度等级</h3>
            <table border="2">
                <thead><tr><th colspan="2">所有取值</th></thead>
                <thead align="center"><th>常温</th><th>生鲜冷链</th></tr></thead>
            </table>
        </row>
        <row>
            <h3>包裹大小规格</h3>
            <table border="2">
                <thead><tr><th colspan="2">所有取值</th></thead>
                <thead align="center"><th>未知</th>><th>小件</th><th>大件</th></tr></thead>
            </table>
        </row>
        <row>
            <h3>签收方式</h3>
            <table border="2">
                <thead><tr><th colspan="2">所有取值</th></thead>
                <thead align="center"><th>是</th><th>否</th></tr></thead>
            </table>
        </row>
        <row>
            <h3>配送时效要求</h3>
            <table border="2">
                <thead><tr><th colspan="9">所有取值</th></thead>
                <thead align="center"><th>未知</th><th>当日达</th><th>次晨达</th><th>三日达</th><th>工作日</th><th>节假日</th><th>夜间配</th><th>上午达</th><th>下午达</th></tr></thead>
            </table>
        </row>
        <row>
            <h3>供应商名称</h3>
            <select id="supplier"></select>
        </row>
        <row>
            <h3>省</h3>
            <select id="province"></select>
        </row>
        <row>
            <h3>市</h3>
            <select id="city"></select>
        </row>
        <row>
            <h3>区</h3>
            <select id="county"></select>
        </row>
</body>
<script>
    $(document).ready(function () {
        supplierNames('../system/supplier/listall');
        provinces('../regioncode/list');
        cities('../regioncode/list');
        countries('../regioncode/list');
    });
    function supplierNames(url) {
            $.ajax({
                url :url,
                type : 'POST',
                dataType : "json",
                success : function(result) {
                    var data=result.data||[];
                    var bb =$(document).find("#supplier");
                    for ( var i in data) {
                        bb.append("<option value='"+data[i].name+"'>"+ data[i].name+ "</option>");
                    }
                }
            });
    }
    function provinces(url) {
        $.ajax({
            url :url,
            type : 'POST',
            dataType : "json",
            success : function(result) {
                var data=result.data||[];
                var bb =$(document).find("#province");
                for ( var i in data) {
                    if(data[i].level==1){
                        bb.append("<option value='"+data[i].name+"'>"+ data[i].name+ "</option>");
                    }

                }
            }
        });
    }
    function cities(url) {
        $.ajax({
            url :url,
            type : 'POST',
            dataType : "json",
            success : function(result) {
                var data=result.data||[];
                var bb =$(document).find("#city");
                for ( var i in data) {
                    if(data[i].level==2){
                        bb.append("<option value='"+data[i].name+"'>"+ data[i].name+ "</option>");
                    }

                }
            }
        });
    }
    function countries(url) {
        $.ajax({
            url :url,
            type : 'POST',
            dataType : "json",
            success : function(result) {
                var data=result.data||[];
                var bb =$(document).find("#county");
                for ( var i in data) {
                    if(data[i].level==3){
                        bb.append("<option value='"+data[i].name+"'>"+ data[i].name+ "</option>");
                    }

                }
            }
        });
    }

</script>
</html>